<template>
	<view>
		<view v-for="(item,index) in dataList"
			  class="cu-item padding-sm" 
			  @click.stop="contentClick(item.id, item.budget)">
			  
			<view class="cu-avatar lg img account-image" 
				  :style="'background-image: url(' + (header + images[Number(item.imageId)].path) +')'"></view>
				  
			<view class="content">
				<view class="text-black" v-text="item.bookName"></view>
				<view class="text-gray text-sm flex" v-text="item.mark"></view>
				<view class="text-gray text-xs">最后更新时间: {{dateFormat(item.latest)}}</view>
			</view>
			<view class="action" @click.stop="detailClick(item.id)">
				<view class="text-gray text-xs">详细&gt;</view>
				<view class="text-red text-xl">123</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {header, images} from '../../static/account-images.js'
	import {dateFormat} from '../../common/dateUtils.js'
	export default {
		name: 'index-book-list',
		props: [
			dataList: {
				required: true,
				validator: data => data instanceof Array
			}
		],
		data() {
			
		},
		methods: {
			dateFormat,
			detailClick(id) {
				this.$emit('detailClick')
			},
			contentClick(id) {
				this.$emit('contentClick')
			}
		}
	}
</script>

<style>
</style>
